{extend name="index@common/base"/} 
{block name="style"}
{/block} {block name="body"}
<div class="layui-body layui-tab-content index-body" id="cont">
	<div class="park-navigation">
		<div class="navigation-icon">
			<i class="fa {$breadCrumb[0]['icon']}"></i>
		</div>
		<div class="navigation-menu">
			<h2>{$breadCrumb[0]['title']}</h2>
			{if isset($breadCrumb[1])}
			<p>{$breadCrumb[0]['remark']}</p>
			{/if}
		</div>
	</div>
	<div class="park-content">
		<div class="content-title">
			<div class="title col-9">
				<h3>{$breadCrumb[1]['title']}</h3>
				<form class="layui-form" action="{:url('inspection/report/search')}" onsubmit="return false;">
					<button class="search-btn" lay-submit lay-filter="search"><img src="__STATIC__/img/base/topsearch01.png"></button>
					<input class="search-input" name="keyword" type="text" placeholder="项目名称" id="keyword"  autocomplete="off">
					<select name="status">
						<option value="">处理状态</option>
						<option value="0">未读</option>
						<option value="1">忽略</option>
						<option value="2">待处理</option>
						<option value="3">已处理</option>
					</select>
					<select name="issueLevel">
						<option value="">严重性</option>
						{volist name="issueLevelList" id="item"}
						<option value="{$item.subsystemName}">{$item.subsystemName}</option>
						{/volist}
					</select>
					<div class="date-duration">
						<div class="layui-input-inline">
							<input type="text" name="start" id="start" autocomplete="off" class="search-input" placeholder="反馈时间">
						</div>
						<div class="layui-input-inline">
							<span>--</span>
						</div>
						<div class="layui-input-inline">
							<input type="text" name="end" id="end" autocomplete="off" class="search-input" placeholder="反馈时间">
						</div>
					</div>
				</form>	
			</div>
			<div class="tool col-1">
				<button id="reload"><i class="fa fa-refresh"></i></button>
			</div>
		</div>
		<div class="layui-content" lay-accordion id="reportTable" data-url="{:url('inspection/report/index')}">
                    
	    </div>
	    <div id="page"></div>
	</div>
</div>
{/block}
{block name="script"}

<script type="text/javascript" src="__JS__/inspection/report.js"></script>

 <script id="tableTemplate" type="text/html">
	
        {{# for(var i = 0;i < d.length; i++){ }}
		<div class="maintab">
        <table class="mission-table">
           	<thead>
			<tr>
                <th>企业:<b>{{d[i].enterprise.fullName}}</b></th>
                <th>巡检区域：<b>{{d[i].areaId}}</b></th>
                <th>巡检员: <b>{{d[i].user.userName}}</b></th>
            </tr>
			</thead>
			<colgroup>
                 <col width="25%">
                 <col width="50%">
				 <col width="20%">
            </colgroup>
			<tbody>
  				<tr>
                 	<th class="collapse">{{d[i].title}}</th>
                 	<th colspan="2" class="collapse">{{d[i].rangeDesc}}</th>
            	</tr>
			</tbody>
        </table>
        {{# if(d[i].items != null){ }}
            <div class="maintab">
                <table class="item-table detail-table">
                    <colgroup>
                        <col width="25%">
                 		<col width="15%">
				 		<col width="15%">
				 		<col width="25%">
						<col width="25%">
                    </colgroup>
                    <tbody>
                        {{# for(var j = 0;j < d[i].items.length; j++){ }}
                        <tr>
                            <td>
                                <p><b>巡检点：</b>{{d[i].items[j].patrolPoint}}</p>
                                <p><b>检查项目：</b>{{d[i].items[j].inspectItem}}(<span style="color: red">{{d[i].items[j].importance}}</span>)</p>
                            </td>
                            <td>
                                {{# if (d[i].items[j].record){ }}
									<p><b>巡检结果: </b>
									{{# if (d[i].items[j].record.status){ }}
									<span style="color:#52d669;font-size:15px;"><i class="fa fa-check"></i></span>
									{{# }else{ }}
									<span style="color:#f35857;font-size:15px;"><i class="fa fa-exclamation-triangle"></i></span>
									{{# } }}
									</p>
									<p><b>巡检时间: </b>{{d[i].items[j].record.createTime}}</p>
								{{# }else{ }}
									<p>没有巡检记录</p>
								{{# } }}
                            </td>
                            <td>
                                 {{# if (d[i].items[j].record && d[i].items[j].record.problem){ }}
									<p><b>问题等级: </b><span style="color:red">{{d[i].items[j].record.problem.issueLevel}}</span></p>
									<p><b>处理状态: </b>
									{{# if (d[i].items[j].record.problem.status == 0){ }}
									<span class="layui-badge-square">未读</span>
									{{# } }}
									{{# if (d[i].items[j].record.status == 1){ }}
									<span class="layui-badge-square layui-bg-gray">忽略</span>
									{{# } }}
									{{# if (d[i].items[j].record.problem.status ==2){ }}
									<span class="layui-badge-square layui-bg-orange">待处理</span>
									{{# } }}
									{{# if (d[i].items[j].record.problem.status ==3){ }}
									<span class="layui-badge-square layui-bg-green">已处理</span>
									{{# } }}
									</p>
								 {{# }else{ }}
									<p>巡检报告暂无</p>
								 {{# } }}
                            </td>
                            <td>
                                 {{# if (d[i].items[j].record && d[i].items[j].record.problem){ }}
									<p><b>问题描述: </b>{{d[i].items[j].record.problem.detail}}</p>
									<p><b>巡检人: </b>{{d[i].items[j].record.problem.inspectionPersonName}}</p>		
								 {{# }else{ }}
									<p>巡检报告暂无</p>
								 {{# } }}		
                            </td>
							<td>
								 {{# if (d[i].items[j].record && d[i].items[j].record.problem){ }}
									<p><b>处理描述: </b>
									{{# if (d[i].items[j].record && d[i].items[j].record.problem.operationDesc){ }}
										{{d[i].items[j].record.problem.operationDesc}}
									{{# }else{ }}
										无
									{{# } }}		
									</p>
									<p><b>处理时间: </b>{{d[i].items[j].record.problem.operationTime}}</p>
									<p><b>处理人: </b>{{d[i].items[j].record.problem.operationName}}</p>		
								 {{# }else{ }}
									<p>暂无处理</p>
								 {{# } }}		
							</td>
                        </tr>
                         {{# } }}
                    </tbody>
                </table>
            </div>
          {{# } }}
		</div>
      {{# } }}
    </script>
{/block}

